﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Store.Manager.ERP.Application.Dtos
{
    public class ProductDto
    {
        [Required(ErrorMessage = "商品编码不能为空")]
        public string Code { get; set; }

        [Required(ErrorMessage = "商品名称不能为空")]
        [MaxLength(50, ErrorMessage = "商品名称不能超过 50 个字符")]
        public string Name { get; set; }

        [Required(ErrorMessage = "商品类别不能为空")]
        [MaxLength(20, ErrorMessage = "商品类别不能超过 20 个字符")]
        public string Category { get; set; }

        [Required(ErrorMessage = "商品尺码不能为空")]
        [MaxLength(10, ErrorMessage = "商品尺码不能超过 10 个字符")]
        public string Size { get; set; }

        [Required(ErrorMessage = "商品颜色不能为空")]
        [MaxLength(20, ErrorMessage = "商品颜色不能超过 20 个字符")]
        public string Color { get; set; }

        [Range(0, double.MaxValue, ErrorMessage = "商品价格不能为负数")]
        public decimal Price { get; set; }

        [Range(0, int.MaxValue, ErrorMessage = "商品库存不能为负数")]
        public int Stock { get; set; }

        [Required(ErrorMessage = "适用季节不能为空")]
        [MaxLength(10, ErrorMessage = "适用季节不能超过 10 个字符")]
        public string Season { get; set; }

        [Required(ErrorMessage = "面料信息不能为空")]
        [MaxLength(50, ErrorMessage = "面料信息不能超过 50 个字符")]
        public string Fabric { get; set; }

        [Required(ErrorMessage = "品牌信息不能为空")]
        [MaxLength(30, ErrorMessage = "品牌信息不能超过 30 个字符")]
        public string Brand { get; set; }

        [MaxLength(200, ErrorMessage = "商品描述不能超过 200 个字符")]
        public string Description { get; set; }
    }
}
